package com.Merlin.myapplication

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class PageOneActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_page_one)

        // 1. 实现从页面一跳转到页面二
        findViewById<View>(R.id.btn_action_next).setOnClickListener {
            // 1.1 创建一个Intent对象
            val intent = Intent(this, PageTwoActivity::class.java)
            // 1.2 携带参数
            intent.putExtra("name", "张三")
            intent.putExtra("age", 18)
            intent.putExtra("height", 1.8f)
            // 1.3 实现页面跳转
            startActivity(intent)
        }
    }
}